package com.neuedu.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neuedu.dao.UserMessageDao;
import com.neuedu.model.UserMessage;
import com.neuedu.service.UserMessageService;

//配置一个spring的服务类,把业务实现类交给spring进行管理 ,由spring完成依赖注入
@Service
public class UserMessageServiceImpl implements UserMessageService {

	//织入--依赖注入
	@Autowired
	private UserMessageDao userMessageDao;
	public void setUserMessageDao(UserMessageDao userMessageDao) {
		this.userMessageDao = userMessageDao;
	}

	@Override
	public int countUserMessage() {
		// TODO Auto-generated method stub
		return userMessageDao.countUserMessage();
	}

	@Override
	public List<UserMessage> findAll(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return userMessageDao.findAll(map);
	}

	@Override
	public int addUserMessage(UserMessage u) {
		// TODO Auto-generated method stub
		return userMessageDao.addUserMessage(u);
	}

	@Override
	public int updateUserMessage(UserMessage u) {
		// TODO Auto-generated method stub
		return userMessageDao.updateUserMessage(u);
	}

	@Override
	public int deleteUserMessage(int id) {
		// TODO Auto-generated method stub
		return userMessageDao.deleteUserMessage(id);
	}

	@Override
	public UserMessage findUserMessageName(UserMessage u) {
		// TODO Auto-generated method stub
		return userMessageDao.findUserMessageName(u);
	}

}
